using System.Xml;
using MbUnit.Framework;

namespace UnitTests
{
	public class XmlTestsBase
	{
		private XmlDocument myDoc;
		protected MyObject myObject;
		protected string attributeOne = "attributeOne";
		protected int attributeTwo = 2;
		protected string elementOne = "elementOne";
		protected int elementTwo = 2;
		protected double elementThree = 3.1415926;
		protected string myProperty = "SomethingCool";

		[SetUp]
		public void SetUp()
		{
			myDoc = new XmlDocument();
			myDoc.Load("SomeDocument.xml");
			myObject = new MyObject();
			XmlNode parentNode = myDoc.SelectSingleNode("/document/myObject");
			myObject.ReadFrom(parentNode);
		}

		protected MyObject GetAMyObject()
		{
			MyObject aMyObject = new MyObject();
			aMyObject.AttributeOne = attributeOne;
			aMyObject.AttributeTwo = attributeTwo;
			aMyObject.ElementOne = elementOne;
			aMyObject.ElementTwo = elementTwo;
			aMyObject.ElementThree = elementTwo;
			MyCoolAnotherObject o = new MyCoolAnotherObject();
			o.MyProperty = myProperty;
			aMyObject.MyAnotherObject = o;
			return aMyObject;

		}

		[TearDown]
		public void TearDown()
		{
		}
	}
}